package com.chuanyang.driverh.mainhome;


import android.os.Bundle;

import com.chuanyang.driverh.R;
import com.chuanyang.driverh.base.BaseTitleActivity;
import com.chuanyang.driverh.mainhome.fragment.WaitTransDriverFragment;
import com.chuanyang.driverh.mainhome.fragment.WaitTransFragment;
import com.chuanyang.driverh.utils.SharedPrefUtil;
import com.chuanyang.driverh.utils.StringUtil;

public class WaitTransActivity extends BaseTitleActivity {
    private WaitTransFragment mFragment;
    private WaitTransDriverFragment mFragmentDriver;
    @Override
    protected int getContentResId() {
        return R.layout.base_single_fragment_activity;
    }

    @Override
    protected void initView(Bundle savedInstanceState) {

    }

    @Override
    protected void initData() {
        setBackImg();
        getTitleTextView().setText("代运实发");
        getRightTextView().setText("筛选");

        if (!StringUtil.isBlank(SharedPrefUtil.getFleetId())){
            mFragment = new WaitTransFragment();
            getSupportFragmentManager().beginTransaction()
                    .add(R.id.single_fragment_content, mFragment).commit();
        }else {
            mFragmentDriver = new WaitTransDriverFragment();
            getSupportFragmentManager().beginTransaction()
                    .add(R.id.single_fragment_content, mFragmentDriver).commit();
        }



    }

    @Override
    protected void initListener() {

    }

    @Override
    protected void baseGoEnsure() {
        if (!StringUtil.isBlank(SharedPrefUtil.getFleetId())){
            mFragment.filter();

        }else {
            mFragmentDriver.filter();
        }



    }
}
